package com.showsu.editor.utils.aliyun.moderaction;

import lombok.AllArgsConstructor;
import lombok.Getter;

/**
 * @author edison
 */

@Getter
@AllArgsConstructor
public enum AliyunModerationRiskLevelEnum {

    high("high", "高风险",3000),
    medium("medium", "中风险",2000),
    low("low", "低风险",1000),
    none("none", "未检测到风险",0),
    unknown("unknown", "未知",-1),
    ;

    /**
     * 错误码
     */
    final String code;

    /**
     * 错误描述
     */
    final String msg;

    final int level;

    public static AliyunModerationRiskLevelEnum getByCode(String code) {
        for(AliyunModerationRiskLevelEnum serviceCodeEnum : AliyunModerationRiskLevelEnum.values()) {
            if (serviceCodeEnum.getCode().equals(code)){
                return serviceCodeEnum;
            }
        }
        return AliyunModerationRiskLevelEnum.unknown;
    }
}
